#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo Please run this script as root.
else
echo -e "\e[31m欢迎使用Chimera Bootstrap安装实用程序V1.1.4.1（Beta) By @Yaya4_4 Follow Me On Twitter Pls.\e[0m"
echo "为安装程序安装依赖项"
apt update
apt install unzip
echo "完成验证是否已安装Cydia基板/替换"
apt remove mobilesubstrate -y
apt remove com.ex.substitute -y
echo "完成.为下载所需的所有文件创建自定义目录. Path (/User/Documents/ChimeraBootstrap)."
rm -rf /User/Documents/ChimeraBootstrap
mkdir /User/Documents/ChimeraBootstrap
echo "完成.正在下载引导程序..."
wget http://geekpwn.asuscomm.com:8848/sileo/bootstrap.zip --directory-prefix=/User/Documents/ChimeraBootstrap
unzip /User/Documents/ChimeraBootstrap/bootstrap.zip -d /User/Documents/ChimeraBootstrap/
echo "完成。将提取到Bootstrap /"
cp -r -f -u /User/Documents/ChimeraBootstrap/bootstrap/* /
echo "完成.下载必要的Deb."
wget http://geekpwn.asuscomm.com:8848/sileo/cydia_2.3_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/zip_3.0_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/wget_1.1.9_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/zsh_5.7.1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/apt_1.8.2_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/apt-key_1.8.2-1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/apt-lib_1.8.2-sileo6_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/bash_4.4.18-1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/bsdprep_1.0_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/bzip2_1.0.6-2_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/coreutils_8.30-1_iphoneos_arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/coreutils-bin_8.30-3_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/darwintools_1-7_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/debianutils_4.8.4-2_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/diffutils_3.7_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/diskdev_cmds_593-1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/dpkg_1.19.4-1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/file_3.3_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/file-cmds_272.250.1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/findutils_4.7_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/gnupg_1.4.23_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/grep_3.4_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/lzma_5.2.4-1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/ncurses_6.1-1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/p7zip_16.02_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/profile.d_0-4_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/sed_4.8_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/shell_cmds_203-3_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/tar_1.31-1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/text-cmds_99-1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/uikittools_2.0.1_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/unrar_5.5.8_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/unzip_6.0_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/org.coolstar.sileo_1.7.4_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
wget http://geekpwn.asuscomm.com:8848/sileo/org.swift.libswift_5.0-electra2_iphoneos-arm.deb --directory-prefix=/User/Documents/ChimeraBootstrap
echo "完成.安装必要的Debs..."
dpkg -i --force-all /User/Documents/ChimeraBootstrap/zip_3.0_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/wget_1.1.9_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/zsh_5.7.1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/apt_1.8.2_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/apt-key_1.8.2-1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/apt-lib_1.8.2-sileo6_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/bash_4.4.18-1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/bzip2_1.0.6-2_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/bsdprep_1.0_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/coreutils_8.30-1_iphoneos_arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/coreutils-bin_8.30-3_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/darwintools_1-7_iphoneos-arm.deb 
dpkg -i --force-all /User/Documents/ChimeraBootstrap/debianutils_4.8.4-2_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/diffutils_3.7_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/diskdev_cmds_593-1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/dpkg_1.19.4-1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/file_3.3_iphoneos-arm.deb 
dpkg -i --force-all /User/Documents/ChimeraBootstrap/file-cmds_272.250.1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/findutils_4.7_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/gnupg_1.4.23_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/grep_3.4_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/lzma_5.2.4-1_iphoneos-arm.deb 
dpkg -i --force-all /User/Documents/ChimeraBootstrap/ncurses_6.1-1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/p7zip_16.02_iphoneos-arm.deb 
dpkg -i --force-all /User/Documents/ChimeraBootstrap/profile.d_0-4_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/sed_4.8_iphoneos-arm.deb 
dpkg -i --force-all /User/Documents/ChimeraBootstrap/shell_cmds_203-3_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/tar_1.31-1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/text-cmds_99-1_iphoneos-arm.deb 
dpkg -i --force-all /User/Documents/ChimeraBootstrap/uikittools_2.0.1_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/unrar_5.5.8_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/unzip_6.0_iphoneos-arm.deb
echo "完成。运行固件配置(./firmware.sh)"
bash /usr/libexec/cydia/firmware.sh
echo "完成. 为 Chimera 安装 Sileo "
wget http://geekpwn.asuscomm.com:8848/sileo/chimera.sources --directory-prefix=/User/Documents/ChimeraBootstrap
rm -rf /etc/apt/sources.list.d/*
rm -rf /etc/apt/sileo.sources/*
cp /User/Documents/ChimeraBootstrap/chimera.sources /etc/apt/sources.list.d
cp -r -f /User/Documents/ChimeraBootstrap/bootstrap/* /
echo "安装 Sileo ＆ Libswift 和 Cydia Deb"
dpkg -i --force-all /User/Documents/ChimeraBootstrap/cydia_2.3_iphoneos-arm.deb
bash /usr/libexec/cydia/firmware.sh
dpkg -i --force-all /User/Documents/ChimeraBootstrap/org.coolstar.sileo_1.7.4_iphoneos-arm.deb
dpkg -i --force-all /User/Documents/ChimeraBootstrap/org.swift.libswift_5.0-electra2_iphoneos-arm.deb
echo "BootStrap 安装完成。安装程序清除安装程序"
rm -rf /Applications/Cydia.app
rm -rf /User/Documents/ChimeraBootstrap
uicache -a
echo "全部完成.感谢您使用安装程序，请升级Sileo中的所有软件包"
killall SpringBoard
fi
